# Maintainer: George Rawlinson <grawlinson@archlinux.org>

pkgname=cowsql
pkgver=1.15.3
pkgrel=1
pkgdesc='An embeddable and replicated SQLite engine with high availability & automatic failover'
arch=('loong64' 'x86_64')
url='https://github.com/cowsql/cowsql'
license=('LGPL3')
depends=('glibc' 'libuv' 'raft' 'sqlite')
makedepends=('git' 'tcl' 'readline' 'zlib')
options=('strip')
_commit='a1d49d0d3e40b32ba655fffe14b7669c2aa1bcec'
source=("$pkgname::git+$url#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  git describe --tags | sed 's/^v//'
}

build() {
  cd "$pkgname"

  autoreconf -i

  ./configure \
    --prefix=/usr \
    --enable-static=no

  make
}

check() {
  cd "$pkgname"

  make check || true
}

package() {
  cd "$pkgname"

  make DESTDIR="$pkgdir" install
}
